Release 10.1A: OpenEdge Development:
.NET Open Clients
Defining the schema for a temp-table parameter
Defining the schema for a Progress 4GL temp-table (
TABLEorTABLE-HANDLE) parameter is a multi-step process.
![]()
To define the schema for a temp-table parameter:
- If the parameter is for input or input-output, define an ADO.NET
DataTableto hold the parameter value.- Define a
TempTableMetaDataobject to hold the parameter schema.- Add field descriptions to the
TempTableMetaDataobject.- Add the
TempTableMetaDataobject and theDataTable(if applicable) as a temp-table parameter to yourParamArrayobject using the appropriate set parameter method.Defining a TempTableMetaData object
For each temp-table (
DataTable), you must define aProgress.Open4GL.Proxy.TempTableMetaDataobject to hold the schema using the following constructor:
dataTableNameSpecifies a name for the specified
DataTable. This name is typically identical to any 4GL temp-table to which this collection is mapped.strongTypeNameSpecifies the type name for a strongly-typed ADO.NET
DataTable, ornull.numFieldsSpecifies the number of fields in the specified
DataTable.bimageFlagSpecifies
trueif the corresponding Progress 4GL temp-table is defined with theBEFORE-TABLEoption, indicating that the temp-table (and hence theDataTable) can be modified. Otherwise, this value must befalseand you cannot pass modified data between the Open Client and the AppServer.numIndexesSpecifies the number of indexes on the table.
multiIxColsSpecifies
nullif there are no indexes or a formatted string that contains all the index info for this temp-table, as follows:
primeUniqueFlagSpecifies a primary index with a value of 1 if the index is unique and a value of 0 if the index is not unique.
primeFld1[,primeFldn]...Specifies the names of one or more fields involved in the primary index.
primeIdxNameSpecifies the primary index name.
uniqueIdxfld1[,uniqueIdxfldn]...Specifies names of one or more fields involved in a unique secondary index.
uniqueIdxNameSpecifies a unique secondary index name.
Thus, a table can have no indexes, a single primary index followed by zero or more secondary unique indexes, or it can have a single secondary unique index followed by zero or more additional secondary unique indexes. Some examples follow:
- Table with a single primary index:
This is a primary unique index named
CustIndexwith one column namedcustNum.- Table with a single secondary index:
This is a secondary unique index named
OrderIndexwith one column namedorderDate.- Table with two indexes:
These two indexes include:
- Table with three indexes:
These three indexes include:
XMLNamespaceSpecifies the namespace for XML serialization or
null.XMLPrefixSpecifies the prefix for XML serialization or
null.Adding field descriptions to the TempTableMetaData object
Add the meta data for each field of the temp-table by calling the
SetFieldMetaData()method on theTempTableMetaDataobject for each column in the temp-table:
fieldNumberSpecifies a 1-based position that corresponds to the position of a mapped field in a Progress 4GL temp-table.
fieldNameSpecifies a name that is typically identical to a mapped field in the corresponding 4GL temp-table. The value cannot be
nulland must be unique among fields (column properties) in the specifiedProDataObjecttype.extentValueSpecifies if and how the field represents an array field in the corresponding temp-table. The value must be 0 or greater. If the value is greater than 1, this column property is many-valued (represents an array field) and the value is its extent. If the property represents a
BLOBorCLOBfield, the value must be 0 or 1.proTypeSpecifies the value of a class constant defined in the Progress.Open4GL.Parameter class. The specified class constant indicates the Progress 4GL data type of the mapped temp-table field. For more information on these class constants, see the sections on specifying the Progress temp-table field data types for the
ProDataTableclass in Chapter 4, " Passing Parameters." To identify the Java data type that the column property assumes for the specified 4GL data type, see the information on data type mapping for temp-table fields in the same chapter.userOrderSpecifies a 0-based user order position for the column property.
xmlMappingReserved for future use. Always specify 0.
Adding the TempTableMetaData with its DataTable as a temp-table parameter
Add the
TempTableMetaDataobject together with ADO.NETDataTableit describes by passing them as parameters of theAddTable()orAddTableHandle()method that you use to add the temp-table parameter to theParamArrayobject. For more information, see the "TABLE and TABLE-HANDLE" section.Example 8–1 adds a temp-table parameter defined with no indexes:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |